[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Labels Define Labels Program Section
Standard Pascal does have a GOTO statement. However, to use it,
declaration of the labels must be made prior to the body of the
program (or subprogram). The labels can then be placed in the body
itself.
Labels are first declared in the label section of the program, using
the syntax:
labels
<lab>,<lab>,...,<lab>;
where each <lab> is a unique sequence of one to four digits.
When used in your program, the label must be followed by a colon and a
statement:
<lab>: <statement>;
To jump to that label, you use the GOTO statement:
goto <lab>;
You cannot jump to a label outside the current block, that is, you
cannot jump out of or into a subprogram.
Turbo Pascal allows you to use regular identifiers, not just numbers,
for labels.
See Also:
label
goto
program
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson